﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WF_QLThuVien.Utilities;
using System.Data;
using WF_QLThuVien.Entities.Sach;
using WF_QLThuVien.Entities;


namespace WF_QLThuVien.Entities.DauSach
{
    public class CDauSach
    {
        private string m_maDauSach;

        public string MaDauSach
        {
            get { return m_maDauSach; }
            set { m_maDauSach = value; }
        }

        private string m_tenDauSach;

        public string TenDauSach
        {
            get { return m_tenDauSach; }
            set { m_tenDauSach = value; }
        }

        private DateTime m_ngayNhap;
       
        public DateTime NgayNhap
        {            
            get { return m_ngayNhap; }
            set { m_ngayNhap = value; }
        }

        private int m_soLuong;

        public int SoLuong
        {
            get { return m_soLuong; }
            set { m_soLuong = value; }
        }

        private double m_giaTien;

        public double GiaTien
        {
            get { return m_giaTien; }
            set { m_giaTien = value; }
        }

        private string m_ngonNgu;

        public string NgonNgu
        {
            get { return m_ngonNgu; }
            set { m_ngonNgu = value; }
        }

        private int m_namXB;

        public int NamXB
        {
            get { return m_namXB; }
            set { m_namXB = value; }
        }

        private string m_nhaXB;

        public string NhaXB
        {
            get { return m_nhaXB; }
            set { m_nhaXB = value; }
        }

        private string m_theLoai;

        public string TheLoai
        {
            get { return m_theLoai; }
            set { m_theLoai = value; }
        }

        private string m_tacGia;

        public string TacGia
        {
            get { return m_tacGia; }
            set { m_tacGia = value; }
        }

        private string m_trangThai;

        public string TrangThai
        {
            get { return m_trangThai; }
            set { m_trangThai = value; }
        }        

        private string m_isbn;

        public string Isbn
        {
            get { return m_isbn; }
            set { m_isbn = value; }
        }

        private List<CSach> m_dsSach;

        internal List<CSach> DsSach
        {
            get { return m_dsSach; }
            set { m_dsSach = value; }
        }

        public CDauSach(DataRow r)
        {
            m_giaTien = double.Parse(r["GiaTien"].ToString());
            m_isbn = r["Isbn"].ToString();
            m_maDauSach = r["DauSachID"].ToString();
            m_namXB = int.Parse(r["NamXB"].ToString());
            m_ngayNhap = DateTime.Parse(r["NgayNhap"].ToString());
            m_ngonNgu = r["NgonNgu"].ToString();
            m_nhaXB = r["NhaXB"].ToString();
            m_soLuong = int.Parse(r["SoLuong"].ToString());
            m_tacGia = r["TacGia"].ToString();
            m_tenDauSach = r["TenDauSach"].ToString();
            m_theLoai = r["TheLoai"].ToString();
            m_trangThai = r["TrangThai"].ToString();
        }

        public CDauSach()
        {
            
        }
    }
}
